<?php

class Account_Form_PasswordResetKey extends Zend_Form
{
	public function init()
	{
		parent::init();

        // Set the method for the display form to POST
		$this
			->setAction('')
			->setMethod('post')
		;

		$stripSlashesFilter = new Euso_Filter_StripSlashes();

		// Create and configure actkey element
		$actkey = new Zend_Form_Element_Text('code');
		$actkeyRegex = new Zend_Validate_Regex('/^[a-fA-F0-9]*$/');
		$actkeyRegex->setMessage(_('Please enter a valid password reset key'));
		$actkey
			->setLabel('Password reset key:')
			->setRequired(true)
			->addFilter($stripSlashesFilter)
			->addFilter('StringTrim')
			->addFilter('StringToLower')
			->addValidator($actkeyRegex)
			->setAttrib('size', 36)
		;
		$this->addElement($actkey);

        // Add the submit button
		$submit = new Zend_Form_Element_Submit('submit');
		$submit
			->setLabel('Reset password')
			->setIgnore(true)
			->setAttrib('class', 'submit')
		;
		$this->addElement($submit);
	}
}
